require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 3,["5"] = 5,["6"] = 6,["7"] = 10,["8"] = 10,["9"] = 10,["11"] = 10,["12"] = 14,["13"] = 15,["14"] = 16,["15"] = 14,["16"] = 46,["17"] = 47,["18"] = 46,["19"] = 57,["20"] = 58,["21"] = 60,["22"] = 61,["23"] = 60,["24"] = 64,["25"] = 65,["27"] = 66,["28"] = 66,["29"] = 67,["30"] = 68,["33"] = 71,["34"] = 72,["35"] = 73,["36"] = 74,["37"] = 75,["39"] = 66,["43"] = 80,["44"] = 80,["45"] = 81,["46"] = 82,["49"] = 85,["50"] = 86,["51"] = 87,["52"] = 88,["54"] = 80,["58"] = 92,["59"] = 92,["60"] = 93,["61"] = 94,["64"] = 97,["65"] = 98,["66"] = 99,["67"] = 100,["69"] = 92,["72"] = 104,["73"] = 57,["74"] = 108,["75"] = 110,["76"] = 111,["77"] = 110,["78"] = 115,["79"] = 116,["80"] = 115,["81"] = 120,["82"] = 121,["83"] = 120,["84"] = 125,["85"] = 126,["86"] = 125,["87"] = 130,["88"] = 131,["89"] = 130,["90"] = 108,["91"] = 10});
local ____exports = {}
local CJ = require("jass.common")
local deg = CJ.Rad2Deg(1)
local rad = CJ.Deg2Rad(1)
____exports.default = __TS__Class()
local SolveLuaAsyn = ____exports.default
SolveLuaAsyn.name = "SolveLuaAsyn"
function SolveLuaAsyn.prototype.____constructor(self)
end
function SolveLuaAsyn.init()
    ____exports.default.tempGroup2 = CJ.CreateGroup()
    _G.ForGroup = ____exports.default.ForGroup
end
function SolveLuaAsyn.TimerStart(whichTimer, timeout, periodic, handlerFunc)
    CJ.TimerStart(whichTimer, timeout, periodic, handlerFunc)
end
function SolveLuaAsyn.ForGroup(whichGroup, callback)
    local unitHandle = nil
    _G.GetEnumUnit = function()
        return unitHandle
    end
    GroupClear(tempGroup)
    GroupClear(____exports.default.tempGroup2)
    do
        local i = 0
        while i <= 1000000 do
            unitHandle = FirstOfGroup(whichGroup)
            if not IsHandle(unitHandle) then
                break
            end
            GroupAddUnit(tempGroup, unitHandle)
            GroupAddUnit(____exports.default.tempGroup2, unitHandle)
            GroupRemoveUnit(whichGroup, unitHandle)
            if i == 1000000 then
                print("ForGroup 循环次数过多！")
            end
            i = i + 1
        end
    end
    do
        local i = 0
        while i <= 1000000 do
            unitHandle = FirstOfGroup(____exports.default.tempGroup2)
            if not IsHandle(unitHandle) then
                break
            end
            GroupAddUnit(whichGroup, unitHandle)
            GroupRemoveUnit(____exports.default.tempGroup2, unitHandle)
            if i == 1000000 then
                print("ForGroup 循环次数过多！")
            end
            i = i + 1
        end
    end
    do
        local i = 0
        while i <= 1000000 do
            unitHandle = FirstOfGroup(tempGroup)
            if not IsHandle(unitHandle) then
                break
            end
            callback()
            GroupRemoveUnit(tempGroup, unitHandle)
            if i == 1000000 then
                print("ForGroup 循环次数过多！")
            end
            i = i + 1
        end
    end
    _G.GetEnumUnit = CJ.GetEnumUnit
end
function SolveLuaAsyn.SolveMathAsyn()
    math.sin = function(r)
        return CJ.sin(r * rad)
    end
    math.cos = function(r)
        return CJ.cos(r * rad)
    end
    math.tan = function(r)
        return CJ.tan(r * rad)
    end
    math.asin = function(v)
        return CJ.asin(v) * deg
    end
    math.acos = function(v)
        return CJ.acos(v) * deg
    end
end
____exports.default = SolveLuaAsyn
return ____exports
